from tkinter import font
import matplotlib.pyplot as plt
import pandas as pd
plt.rcParams['svg.fonttype'] = 'none'

# 创建数据框架
data = {
    'Round': [5, 10, 15, 20, 25, 30, 35, 40, 45, 50],
    'SPS': [58.63097937,37.46403694,40.75079183,21.76377042,28.20693488,41.53343935,23.28095838,18.2345043,41.09483288,48.20102094],
    'OGS': [51.74046393,54.3106276,46.09386619,25.85832878,32.57875892,41.79359774,34.59715084,15.78964949,32.75706347,28.16181886],
    'ORDP': [24.15464919,23.99353181,23.75864974,14.16474152,17.30151006,21.43898553,14.98414637,12.77387313,12.70790869,10.91775432],
}

df = pd.DataFrame(data)

# 绘制数据
plt.figure(figsize=(8, 6))
plt.plot(df['Round'], df['SPS'], marker='s', markersize=10, label='SPS')
plt.plot(df['Round'], df['OGS'], marker='^', markersize=10, label='OGS')
plt.plot(df['Round'], df['ORDP'], marker='*', markersize=10, label='ORDP')

# plt.title('Comparison of SPF and Cplex Algorithms')
plt.xlabel('Round', fontsize=14)
plt.ylabel('Congestion Ratio', fontsize=14)
plt.legend(fontsize='large')  # 设置图例的字体大小为大

plt.grid(True)
# plt.show()
plt.savefig("output/in_cluster_cr_var_capacity.svg", format="svg")
